from django.conf.urls.defaults import *
from reviews.api import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('reviews.views',
    # Example:
    # (r'^dishpop/', include('dishpop.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

	(r'^$', 'home'),
    #(r'^action/(?P<action_string>[a-z]+)/dish/(?P<dish_id>\d+)/$', 'submit_preference_for_dish'),
    #(r'^user/(?P<user_name>\w+)/$', 'user_page'),
    (r'^t/(?P<tag_name>[a-z0-9-]+)/$', 'tag'),
    (r'^p/(?P<place_slug>[a-z0-9-]+)/$', 'place'),
    (r'^p/(?P<place_id>\d+)/add_dish/$', 'add_dish'),
    (r'^p/(?P<place_id>\d+)/add_dish/name_check/$', 'dish_name_check'),

    (r'^d/(?P<dish_id>\d+)$', 'dish'),
	(r'^d/(?P<dish_slug>[a-z0-9-]+)$', 'dish_page'),
    # (r'^place/(?P<place_slug>[a-z0-9-]+)/$', 'place'),
    (r'^submit/dish/$', 'submit_dish'),    
    (r'^submit/photo/dish/(?P<dish_id>\d+)/$', 'add_photo'),    
    (r'^submit/tags/dish/(?P<dish_id>\d+)/$', 'submit_tags'),
    # (r'^submit/review/dish/(?P<dish_id>\d+)/$', 'submit_review'),
    (r'^submit/review/dish/$', 'submit_dish'),
    (r'^submit/ranking/$', 'submit_ranking'),
    # (r'^delete/$', 'delete_review_or_image'),
    (r'^search/$', 'search'),
    (r'^logout/$', 'log_user_out'),

    # api
    (r'^api/feed/d/(?P<dish_id>\d+)/$', get_feed),
    (r'^api/ranks/t/(?P<tag_id>\d+)/$', get_my_ranks),
    (r'^api/ranks/t/(?P<tag_id>\d+)/(?P<dish_id>\d+)/$', delete_rank),
    (r'^api/dishes/t/(?P<tag_id>\d+)/$', get_dishes_for_tag),
    (r'^api/photos/d/(?P<dish_id>\d+)/$', get_dish_photo_urls),
)